Charging Method, Apparatus, And System

ABSTRACT

Example charging methods and apparatus are described. One example method includes sending a service resource create request to a charging system by a charging trigger apparatus. The charging trigger apparatus receives a service resource create response sent by the charging system. The service resource create request is used to request the charging system to create a service resource corresponding to a service in a session. The session is used to provide a data connection service to user equipment. The service resource is used to manage requesting for a quota for the service in the session and/or manage reporting of usage information of the service in the session. The service resource create response includes a first resource identifier, and the first resource identifier is used to identify the service resource that corresponds to the service in the session and that is created by the charging system.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of U.S. patent application Ser. No.16/821,541 filed on Mar. 17, 2020, which is a continuation ofInternational Application No. PCT/CN2018/098208, filed on Aug. 2, 2018,which claims priority to Chinese Patent Application No. 201711139728.2,filed on Nov. 16, 2017. All of the afore-mentioned patent applicationsare hereby incorporated by reference in their entireties.

TECHNICAL FIELD

This disclosure relates to the field of communications technologies, andin particular, to a charging method, an apparatus, and a system.

BACKGROUND

At present, in a communications system, charging for an online chargingservice and charging for an offline charging service are performed indifferent charging systems. As shown in FIG. 1 a charging triggerapparatus in a communications system communicates with an onlinecharging system by using an Ro interface, and communicates with anoffline charging system by using an Rf interface. The online chargingsystem is configured to perform charging for an online charging service,and the offline charging system is configured to perform charging for anoffline charging service.

However, the separation between the online charging system and theoffline charging system makes service charging relatively complex.

SUMMARY

A charging method, an apparatus, and a system that are provided inembodiments of this disclosure help simplify a manner of charging for aservice.

According to a first aspect, an embodiment of this disclosure provides acharging method, including:

sending, by a charging trigger apparatus, a service resource createrequest to a charging system, and then receiving a service resourcecreate response sent by the charging system, wherein the serviceresource create request is used to request the charging system to createa service resource corresponding to a service in a session, the sessionis used to provide a data connection service to user equipment, theservice resource is used to manage requesting for a quota for theservice in the session and/or manage reporting of usage information ofthe service in the session, the service resource create responseincludes a first resource identifier, and the first resource identifieris used to identify the service resource that corresponds to the servicein the session and that is created by the charging system.

In this embodiment of this disclosure, the service resource isintroduced, so that by operating the service resource, both charging foran online charging service and charging for an offline charging servicecan be performed, thereby integration of both online charging andoffline charging is achieved. Compared with a manner in which onlinecharging and offline charging are separately performed in the prior art,a manner of charging for a service is simplified to some extent.

In this embodiment of this disclosure, to improve efficiency andscalability of the charging system and the charging trigger apparatus,in a possible design, when the charging trigger apparatus needs torequest a quota for the service in the session or report usageinformation of the service in the session and there is no availableservice resource, the charging trigger apparatus sends the serviceresource create request to the charging system.

In a possible design, the service resource create request includes asession identifier and a user identifier corresponding to the userequipment, and the session identifier is used to identify the session.This technical solution helps the charging system be able to distinguishamong different types of services of different users during servicecharging.

In a possible design, the service resource create request is used torequest the charging system to create a first service resource, and thefirst service resource corresponds to all services in the session,wherein all the services in the session are online charging services; orall the services in the session are offline charging services; or allthe services in the session include an online charging service and anoffline charging service.

In a possible design, the service resource create request is used torequest the charging system to create a second service resource and athird service resource, wherein the second service resource correspondsto an online charging service in the session, and the third serviceresource corresponds to an offline charging service in the session; orin a possible design, the service resource create request is used torequest the charging system to create a service resource correspondingto an online charging service in the session; or in a possible design,the service resource create request is used to request the chargingsystem to create a service resource corresponding to an offline chargingservice in the session.

In a possible design, the service resource create request is used torequest the charging system to create at least one service resource, andeach of the at least one service resource corresponds to a service, inthe session, that belongs to a same rating group.

In a possible design, when the service corresponding to the serviceresource that the charging system is requested to create by the serviceresource create request includes an online charging service, the serviceresource create request further includes quota request information forthe online charging service and a rating group corresponding to thequota request information; or

when the service corresponding to the service resource that the chargingsystem is requested to create by the service resource create requestincludes an offline charging service, the service resource createrequest further includes a requested virtual quota for the offlinecharging service and a rating group corresponding to the requestedvirtual quota; or when the service corresponding to the service resourcethat the charging system is requested to create by the service resourcecreate request includes an offline charging service, the serviceresource create request further includes usage information of theoffline charging service and a rating group corresponding to the usageinformation.

This technical solution helps improve accuracy of service chargingperformed by the charging system.

In a possible design, the charging trigger apparatus sends a serviceresource update request to the charging system, wherein the serviceresource update request includes a second resource identifier, and thesecond resource identifier is used to identify a service resource, inthe service resource identified by the first resource identifier, thatthe charging system is requested to update. This technical solutionhelps further improve the accuracy of service charging performed by thecharging system.

In a possible design, when the service corresponding to the serviceresource identified by the second resource identifier include an onlinecharging service, the service resource update request further includesquota request information for the online charging service , a ratinggroup corresponding to the quota request information, usage informationof the online charging service and a rating group corresponding to theusage information; or when the service corresponding to the serviceresource identified by the second resource identifier include an onlinecharging service, the service resource update request further includesquota request information for the online charging service and a ratinggroup corresponding to the quota request information; or when theservice corresponding to the service resource identified by the secondresource identifier includes an online charging service, the serviceresource update request further includes usage information of the onlinecharging service and a rating group corresponding to the usageinformation; or

when the service corresponding to the service resource identified by thesecond resource identifier include an offline charging service, theservice resource update request further includes a requested virtualquota for the offline charging service, a rating group corresponding tothe requested virtual quota, usage information of the offline chargingservice and a rating group corresponding to the usage information; orwhen the service corresponding to the service resource identified by thesecond resource identifier includes an offline charging service, theservice resource update request further includes a requested virtualquota for the offline charging service and a rating group correspondingto the requested virtual quota; or when the service corresponding to theservice resource identified by the second resource identifier includesan offline charging service, the service resource update request furtherincludes usage information of the offline charging service and a ratinggroup corresponding to the usage information.

This embodiment of this disclosure further provides a possible manner oftriggering the charging trigger apparatus to send the service resourceupdate request to the charging system: After receiving a serviceresource update notification sent by the charging system, the chargingtrigger apparatus sends the service resource update request to thecharging system. Optionally, the service resource update notificationincludes a third resource identifier, and the third resource identifieris used to identify a service resource, in the service resourceidentified by the first resource identifier, that the charging systemrequests to be updated.

Further, in a possible design, the service resource update requestfurther includes a rating group to which a service for which thecharging system requests a service resource to be updated belongs, andthe service is in the services corresponding to a service resourceidentified by the third resource identifier.

In addition, another possible manner of triggering the charging triggerapparatus to send the service resource update request to the chargingsystem is: When a first charging trigger condition is met, the chargingtrigger apparatus sends the service resource update request to thecharging system.

In a possible design, the charging trigger apparatus sends a serviceresource delete request to the charging system, wherein the serviceresource delete request includes a fourth resource identifier, and thefourth resource identifier is used to identify a service resource to bedeleted from the service resource identified by the first resourceidentifier. The foregoing manner helps the charging system release thecreated service resource, to improve resource utilization in thecharging system.

For example, when a second charging trigger condition is met, thecharging trigger apparatus sends the service resource delete request tothe charging system.

In a possible design, when the service corresponding to the serviceresource identified by the fourth resource identifier include an onlinecharging service, the service resource delete request further includesusage information of the online charging service and a rating groupcorresponding to the usage information; or when the servicecorresponding to the service resource identified by the fourth resourceidentifier includes an offline charging service, the service resourcedelete request further includes usage information of the offlinecharging service and a rating group corresponding to the usageinformation.

According to a second aspect, an embodiment of this disclosure providesa charging method, including:

receiving, by a charging system, a service resource create request sentby a charging trigger apparatus, and then sending a service resourcecreate response to the charging trigger apparatus, wherein the serviceresource create request is used to request the charging system to createa service resource corresponding to a service in a session, the sessionis used to provide a data connection service to user equipment, theservice resource is used to manage requesting for a quota for theservice in the session and/or manage reporting of usage information ofthe service in the session, the service resource create responseincludes a first resource identifier, and the first resource identifieris used to identify the service resource that corresponds to the servicein the session and that is created by the charging system.

In this embodiment of this disclosure, the service resource isintroduced, so that by operating the service resource, both charging foran online charging service and charging for an offline charging servicecan be performed, thereby integration of both online charging andoffline charging is achieved. Compared with a manner in which onlinecharging and offline charging are separately performed in the prior art,a manner of charging for a service is simplified to some extent.

In a possible design, the service resource create request includes asession identifier and a user identifier corresponding to the userequipment, and the session identifier is used to identify the session.This technical solution helps the charging system be able to distinguishamong different types of services of different users during servicecharging.

In a possible design, the service resource create request is used torequest the charging system to create a first service resource, whereinthe first service resource corresponds to all services in the session,wherein all the services in the session are online charging services; orall the services in the session are offline charging services; or allthe services in the session include an online charging service and anoffline charging service.

In a possible design, the service resource create request is used torequest the charging system to create a second service resource and athird service resource, wherein the second service resource correspondsto an online charging service in the session, and the third serviceresource corresponds to an offline charging service in the session; orin a possible design, the service resource create request is used torequest the charging system to create a service resource correspondingto an online charging service in the session; or in a possible design,the service resource create request is used to request the chargingsystem to create a service resource corresponding to an offline chargingservice in the session.

In a possible design, the service resource create request is used torequest the charging system to create at least one service resource, andeach of the at least one service resource corresponds to a service, inthe session, that belongs to a same rating group.

In a possible design, when the service corresponding to the serviceresource that the charging system is requested to create by the serviceresource create request includes an online charging service, the serviceresource create request further includes quota request information forthe online charging service and a rating group corresponding to thequota request information; or

when the service corresponding to the service resource that the chargingsystem is requested to create by the service resource create requestincludes an offline charging service, the service resource createrequest further includes a requested virtual quota for the offlinecharging service and a rating group corresponding to the requestedvirtual quota; or when the service corresponding to the service resourcethat the charging system is requested to create by the service resourcecreate request includes an offline charging service, the serviceresource create request further includes usage information of theoffline charging service and a rating group corresponding to the usageinformation.

This technical solution helps improve accuracy of service chargingperformed by the charging system.

It should be noted that, for example, that the charging system reserves,from account balance of the user equipment, a quota that corresponds tothe rating group and that is requested by using the service resourcecreate request, and allocates the quota to the online charging servicemay be applied to a case in which the service resource create requestfurther includes the quota request information for the online chargingservice and the rating group corresponding to the quota requestinformation. For another example, that the charging system allocates, tothe offline charging service, a virtual quota that corresponds to therating group and that is requested by using the service resource createrequest, without reserving the virtual quota from account balance of theuser equipment may be applied to a case in which the service resourcecreate request further includes the requested virtual quota for theoffline charging service and the rating group corresponding to therequested virtual quota. For another example, that the charging systemgenerates a charging data record based on the usage information of theoffline charging service and the rating group corresponding to the usageinformation may be applied to a case in which the service resourcecreate request further includes the usage information of the offlinecharging service and the rating group corresponding to the usageinformation.

In a possible design, the charging system receives a service resourceupdate request sent by the charging trigger apparatus, and updates,based on the service resource update request, a service resourcecorresponding to a second resource identifier, wherein the serviceresource update request includes the second resource identifier, and thesecond resource identifier is used to identify a service resource, inthe service resource identified by the first resource identifier, thatthe charging system is requested to update. This technical solutionhelps further improve the accuracy of charging performed by the chargingsystem for a service.

In a possible design, when the service corresponding to the serviceresource identified by the second resource identifier includes an onlinecharging service, the service resource update request further includesquota request information for the online charging service, a ratinggroup corresponding to the quota request information, usage informationof the online charging service and a rating group corresponding to theusage information; or when the service corresponding to the serviceresource identified by the second resource identifier includes an onlinecharging service, the service resource update request further includesquota request information for the online charging service and a ratinggroup corresponding to the quota request information; or when theservice corresponding to the service resource identified by the secondresource identifier includes an online charging service, the serviceresource update request further includes usage information of the onlinecharging service and a rating group corresponding to the usageinformation; or

when the service corresponding to the service resource identified by thesecond resource identifier includes an offline charging service, theservice resource update request further includes a requested virtualquota for the offline charging service, a rating group corresponding tothe requested virtual quota, usage information of the offline chargingservice and a rating group corresponding to the usage information; orwhen the service corresponding to the service resource identified by thesecond resource identifier includes an offline charging service, theservice resource update request further includes a requested virtualquota for the offline charging service and a rating group correspondingto the requested virtual quota or when the service corresponding to theservice resource identified by the second resource identifier includesan offline charging service, the service resource update request furtherincludes usage information of the offline charging service and a ratinggroup corresponding to the usage information.

It should be noted that the charging system may update, based on theservice resource update request in the following manners, the serviceresource corresponding to the second resource identifier:

For example, that the charging system reserves, from account balance ofthe user equipment, a quota that corresponds to the rating group andthat is requested by using the service resource create request,allocates the quota to the online charging service, and subtracts, fromthe quota allocated to the online charging service based on the usageinformation of the online charging service and the rating groupcorresponding to the usage information, a part used by the onlinecharging service may be applied to a case in which the service resourceupdate request further includes the quota request information for theonline charging service and the rating group corresponding to the quotarequest information, and the usage information of the online chargingservice and the rating group corresponding to the usage information. Foranother example, that the charging system reserves, from account balanceof the user equipment, a quota that corresponds to the rating group andthat is applied for by using the service resource create request, andallocates the quota to the online charging service may he applied to acase in which the service resource create request further includes thequota request information for the online charging service and the ratinggroup corresponding to the quota request information. For anotherexample, that the charging system subtracts, from a quota allocated tothe online charging service based on the usage information of the onlinecharging service and the rating group corresponding to the usageinformation, a part used by the online charging service may be appliedto a case in which the service resource update request further includesthe usage information of the online charging service and the ratinggroup corresponding to the usage information. For another example, thatthe charging system allocates, to the offline charging service, avirtual quota that corresponds to the rating group and that is requestedby using the service resource create request, and generates a chargingdata record based on the usage information of the offline chargingservice and the rating group corresponding to the usage information maybe applied to a case in which the service resource update requestfurther includes the requested virtual quota for the offline chargingservice and the rating group corresponding to the requested virtualquota, and the usage information of the offline charging service and therating group corresponding to the usage information. For anotherexample, that the charging system allocates, to the offline chargingservice, a virtual quota that corresponds to the rating group and thatis requested by using the service resource create request may he appliedto a case in which the service resource update request further includesthe requested virtual quota for the offline charging service and therating group corresponding to the requested virtual quota. For anotherexample, that the charging system generates a charging data record basedon the usage information of the offline charging service and the ratinggroup corresponding to the usage information may be applied to a case inwhich the service resource create request further includes the usageinformation of the offline charging service and the rating groupcorresponding to the usage information.

This embodiment of this disclosure further provides a possible manner oftriggering the charging trigger apparatus to send the service resourceupdate request to the charging system: After sending a service resourceupdate notification to the charging trigger apparatus, the chargingsystem receives the service resource update request sent by the chargingtrigger apparatus. The service resource update notification includes athird resource identifier, and the third resource identifier is used toidentify a service resource, in the service resource identified by thefirst resource identifier, that the charging system requests to beupdated.

Further, in a possible design, the service resource update requestfurther includes a rating group to which a service for which thecharging system requests a service resource to be updated belongs, andthe service is in the services corresponding to a service resourceidentified by the third resource identifier.

In a possible design, the charging system receives a service resourcedelete request sent by the charging trigger apparatus, and deletes,based on the service resource delete request, a service resourceidentified by a fourth resource identifier, wherein the service resourcedelete request includes the fourth resource identifier, and the fourthresource identifier is used to identify a service resource to be deletedfrom the service resource identified by the first resource identifier.The foregoing mariner helps the charging system release the createdservice resource, to improve resource utilization in the chargingsystem.

In a possible design, when the service corresponding to the sell iceresource identified by the fourth resource identifier includes an onlinecharging service, the service resource delete request further includesusage information of the online charging service and a rating groupcorresponding to the usage information; or when the servicecorresponding to the service resource identified by the fourth resourceidentifier includes an offline charging service, the service resourcedelete request further includes usage information of the offlinecharging service and a rating group corresponding to the usageinformation.

It should be noted that the charging system subtracts, from a quota forthe online charging service based on the usage information of the onlinecharging service and the rating group corresponding to the usageinformation, a part used by the online charging service. Such technicalsolution may be applied to a case in which the service resource deleterequest further includes the usage information of the online chargingservice and the rating group corresponding to the usage information.That the charging system generates a charging data record based on theusage information of the offline charging service and the rating groupcorresponding to the usage information may be applied to a case in whichthe service resource delete request further includes the usageinformation of the offline charging service and the rating groupcorresponding to the usage information.

According to a third aspect, a charging trigger apparatus provided in anembodiment of this disclosure may be a network device, or may be a chipin a network device. The charging trigger apparatus has a function ofimplementing the technical solutions of the first aspect and thepossible designs of the first aspect. The function may be implemented byusing hardware, or may be implemented by hardware executingcorresponding software. The hardware or the software includes one ormore modules corresponding to the foregoing function.

In a possible design, the charging trigger apparatus includes aprocessing unit and a communications unit. The processing unit may be,for example, a processor. The communications unit may be, for example, acommunications interface. Optionally, the processor may be connected tothe communications interface in a wired manner such as an optical fiberor a twisted pair. The communications unit may alternatively be atransceiver, and the transceiver may include a radio frequency circuit.Optionally, the processor may be connected to the transceiver in awireless manner such as wireless fidelity (Wi-Fi).

Specifically, the processing unit is configured to generate a serviceresource create request; and the communications unit is configured to:send the service resource create request to a charging system, and thenreceive a service resource create response sent by the charging system.The service resource create request is used to request the chargingsystem to create a service resource corresponding to a service in asession, the session is used to provide a data connection service touser equipment, the service resource is used to manage requesting for aquota for the service in the session and/or manage reporting of usageinformation of the service in the session, the service resource createresponse includes a first resource identifier, and the first resourceidentifier is used to identify the service resource that corresponds tothe service in the session and that is created by the charging system.

In another possible design, the charging trigger apparatus includes aprocessor and a memory. The memory is configured to store a program, andthe processor is configured to invoke the program stored in the memory,to implement the charging method in any one of the first aspect or thepossible designs of the first aspect. It should be noted that theprocessor may send or receive data by using an input/output interface, apin, a circuit, or the like. The memory may be a register, a cache, orthe like in the chip. In addition, the memory may alternatively he astorage unit, such as a read-only memory (ROM), another type of staticstorage device that can store static information and an instruction, ora random access memory (RAM), located outside of the chip in the networkdevice.

The processor mentioned in any one of the foregoing possible designs maybe a general-purpose central processing unit (CPU), a microprocessor, anapplication-specific integrated circuit (ASIC), or one or moreintegrated circuits that are configured to control the program ofimplementing the charging method in any one of the first aspect or thepossible designs of the first aspect.

According to a fourth aspect, a charging system provided in anembodiment of this disclosure may be a network device, or may he a chipin a network device. The charging system has a function of implementingthe technical solutions of the second aspect and the possible designs ofthe second aspect. The function may he implemented by using hardware, ormay he implemented by hardware executing corresponding software. Thehardware or the software includes one or more modules corresponding tothe foregoing function.

In a possible design, the charging system includes a processing unit anda communications unit. The processing unit may be, for example, aprocessor. The communications unit may be, for example, a communicationsinterface. Optionally, the processor may be connected to thecommunications interface in a wired manner such as an optical fiber or atwisted pair. The communications unit may alternatively be atransceiver, and the transceiver may include a radio frequency circuit.Optionally, the processor may be connected to the transceiver in awireless manner such as Wi-Fi.

Specifically, the communications unit is configured to receive a serviceresource create request sent by a charging trigger apparatus. Theservice resource create request is used to request the charging systemto create a service resource corresponding to a service in a session,the session is used to provide a data connection service to userequipment, and the service resource is used to manage requesting for aquota for the service in the session and/or manage reporting of usageinformation of the service in the session. The processing unit isconfigured to: after the communications unit receives the serviceresource create request, generate a service resource create response.The service resource create response includes a first resourceidentifier, and the first resource identifier is used to identify theservice resource that corresponds to the service in the session and thatis created by the charging system. Then the communications unit isfurther configured to send the service resource create response to thecharging trigger apparatus.

In another possible design, the charging system includes a processor anda memory. The memory is configured to store a program, and the processoris configured to invoke the program stored in the memory, to implementthe charging method in any one of the second aspect or the possibledesigns of the second aspect. It should be noted that the processor maysend or receive data by using an input/output interface, a pin, acircuit, or the like. The memory may be a register, a cache, or the likein the chip. In addition, the memory may alternatively be a storageunit, such as a ROM, another type of static storage device that canstore static information and an instruction, or a RAM, located outsideof the chip in the network device.

The processor mentioned in any of the foregoing possible designs may bea general-purpose CPU, a microprocessor, an ASIC, or one or moreintegrated circuits that are configured to control the program ofimplementing the charging method in any one of the second aspect or thepossible designs of the second aspect.

According to a fifth aspect, an embodiment of this disclosure furtherprovides a computer-readable storage medium. The computer-readablestorage medium stores a program, and when the program is run on acomputer, the computer is enabled to perform the method in the foregoingaspects.

According to a sixth aspect, this disclosure further provides a computerprogram product including an instruction. When the computer programproduct is run on a computer, the computer is enabled to perform themethod in the foregoing aspects.

According to a seventh aspect, an embodiment of this disclosure furtherprovides a communications system, including the charging triggerapparatus in any one of the third aspect or the possible designs of thethird aspect, and the charging system in any one of the fourth aspect orthe possible designs of the fourth aspect.

In addition, for technical effects of any one of the possible design ofthe second aspect to the seventh aspect, refer to the technical effectsof different design of the first aspect, and details are not describedherein again.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 is a schematic diagram of a charging architecture in thebackground;

FIG. 2 is a schematic diagram of a possible network architecture towhich an embodiment of this disclosure is applicable;

FIG. 3 is a schematic diagram of another possible network architectureto which an embodiment of this disclosure is applicable;

FIG. 4 is a schematic diagram of a charging architecture according to anembodiment of this disclosure;

FIG. 5 is a schematic flowchart of a charging method according to anembodiment of this disclosure;

FIG. 6 is a schematic diagram of a charging trigger apparatus accordingto an embodiment of this disclosure;

FIG. 7 is a schematic diagram of a charging trigger apparatus accordingto an embodiment of this disclosure;

FIG. 8 is a schematic diagram of a charging system according to anembodiment of this disclosure;

FIG. 9 is a schematic diagram of a charging system according to anembodiment of this disclosure; and

FIG. 10 is a schematic diagram of a communications system according toan embodiment of this disclosure.

DESCRIPTION OF EMBODIMENTS

FIG. 2 is a schematic diagram of a possible network architecture towhich an embodiment of this disclosure is applicable. The networkarchitecture is a 4th generation mobile communication technology (4G)network architecture. Network elements in the 4G architecture includeuser equipment, a mobility management entity (MME), a serving GPRSsupport node (SGSN), a home subscriber server (HSS), a serving gateway(S-GW), a packet data network gateway (PDN gateway, P-GW), a policy andcharging rules function (PCRF) entity, an evolved universal terrestrialradio access network (E-TURAN), and the like.

The E-UTRAN includes a plurality of evolved NodeBs (eNodeB). The eNodeBsare interconnected to each other by using an X2 interface, the eNodeBsare interconnected to an evolved packet core (EPC) by using an S Iinterface, and the eNodeBs are interconnected to the user equipment byusing LTE-Uu interface.

Main functions of the mobility management entity (MME) are: supporting anon-access stratum (NAS) message and security thereof, track area (TA)list management, P-GW and S-GW selection, MME selection when a cross-MMEhandover is performed, selection of an SGSN during a handover to a 2G/3Gaccess system, user authentication, roaming control and bearermanagement, and mobility management between core network nodes ofdifferent 3rd generation partnership project (3GPP) access networks.

The S-GW is a gateway terminated at an E-UTRAN interface, and mainfunctions of the S-GW include: When user equipment is handed overbetween base stations, the S-GW is used as a local anchor point andassists in completing a reordering function of the base stations. When ahandover is performed between different 3GPP access systems, the S-GW isused as a mobility anchor point; performs a lawful interceptionfunction, data packet routing and forwarding, and packet marking onuplink and downlink transmission layers; and is used, for example, forcharging between operators.

The P-GW is a gateway oriented to a packet data network (PDN) andterminated at an SGi interface. If the user equipment accesses aplurality of PDNs, the user equipment corresponds to one or more P-GWs.Main functions of the P-GW include: a user equipment-based packetfiltering function, a lawful interception function, an interact protocol(IP) address allocation function for the user equipment, packet-transferlevel marking performed in uplink, uplink and downlink service-levelcharging and control of a service level threshold, control ofservice-based uplink and downlink rates, and the like.

The HSS is a database configured to store subscription information ofthe user equipment, and a home network may include one or more HSSs. TheHSS is responsible for storing information related to the userequipment, for example, a user identifier, a number and routinginformation, security information, location information, and profileinformation.

The SGSN may be configured to exchange signaling when user equipment ishanded over between a 2G/3G access network and an E-UTRAN 3GPP accessnetwork. Functions of the SGSN include P-GW and S-GW selection, and MMEselection for the user equipment that is handed over to the E-UTRAN 3GPPaccess network.

The PCRF entity is terminated at an Rx interface and a Ox interface. Ina non-roaming scenario, there is only one PCRF related to anIP-connectivity access network (IP-CAN) session of the user equipment ina home public land mobile network (HPLMN); or in a roaming scenario andwhen a service flow is local breakout, there may be two PCRFs related toan IP-CAN session of the user equipment.

The user equipment is a device having a wireless sending and receivingfunction, and may be deployed on the land, including an indoor oroutdoor device, a hand-held device, or an in-vehicle device; or may bedeployed on the water (for example, on a steamer); or may be deployed inthe air (for example, on an air plane, a balloon, or a satellite).Specifically, the user equipment may be user equipment (UE) that isaccessible to a mobile network, a mobile phone, a tablet computer (pad),a computer having a wireless sending and receiving function, a virtualreality (VR) terminal, an augmented reality (AR) terminal, a wirelessterminal in industrial control, a wireless terminal in self driving, awireless terminal in telemedicine or remote medical, a wireless terminalin a smart grid, a wireless terminal in transportation safety, awireless terminal in a smart city, a wireless terminal in a smart home,or the like.

FIG. 3 is a schematic diagram of another possible network architectureto which an embodiment of this disclosure is applicable. The networkarchitecture is a 5th generation mobile communication technology (5G)network architecture. The 5G architecture may include user equipment, aradio access network (RAN), an AMF entity, a session management function(SMF) entity, a user plane function (UPF) entity, a unified datamanagement (UDM) entity, an authentication server function (AUSF)entity, and a data network (DN). In addition to the network elementsshown in FIG. 2, the 5G network architecture may further include anauthentication credential repository and processing function (ARPF)entity, a security anchor function (SEAF) entity, and the like.

A main function of the RAN is controlling the user equipment towirelessly connect to a mobile communications network. The RAN is a partof a mobile communications system, and implements a radio accesstechnology. Conceptually, the RAN resides in a device (such as a mobilephone, a computer, or any remote control machine) and provides aconnection to a core network thereof. A RAN device includes but is notlimited to: an NR (new radio) in 5G, an evolved NodeB (eNB), a radionetwork controller (RNC), a NodeB (node B, NB), a base stationcontroller (BSC), a base transceiver station (BTS), a home base station(for example, a home evolved NodeB or a home NodeB, HNB), a base bandunit (BBU), a transmitting and receiving point (TRP), a transmittingpoint (TP), a mobile switching center, and the like. In addition, theRAN device may further include a wireless fidelity (Wi-Fi) access point(AP) and the like.

The AMF entity is responsible for access management and mobilitymanagement of the user equipment. In an actual application, the AMFentity includes a mobility management function of an MME in a 4G networkarchitecture, and an access management function is added.

The SMF entity is responsible for session management, such as usersession establishment.

The UPF entity is a user plane function network element and is mainlyresponsible for connecting to an external network. The UPF entityincludes related functions of an S-GW and a P-GW in the 4G networkarchitecture.

The DN is a network responsible for providing a service to the userequipment. For example, some DNs provide an internet access function tothe user equipment, and other DNs provide an SMS message function to theuser equipment, and the like.

The AUSF entity has an authentication server function and is configuredto terminate an authentication function requested by the SEAF.

The UDM entity may store subscription information of the user equipment,and may implement a function similar to that of a backend of an HSS in4G.

The ARPF entity has an authentication credential repository andprocessing function and is configured to store a long-termauthentication credential of the user equipment, such as a permanent keyK. In 5G, the function of the ARPF may be integrated into the UDMentity.

The SEAF entity is configured to complete a process of authenticatingthe user equipment. In 5G, the function of the SEAF may he integratedinto the AMF entity.

For the user equipment, refer to the user equipment in the networkarchitecture shown in FIG. 2.

The embodiments of this disclosure are applicable to both the 4G networkarchitecture shown in FIG. 2 and the 5G network architecture shown inFIG. 3.

A charging trigger apparatus in the embodiments of this disclosure maybe a policy and charging enforcement function (PCEF) in the P-GW shownin FIG. 2, or may be the SMF entity shown in FIG. 3. This is not limitedin the embodiments of this disclosure.

FIG. 4 is a schematic diagram of a charging architecture according to anembodiment of this disclosure. The charging architecture includes acharging trigger apparatus and a charging system. The charging triggerapparatus and the charging system may communicate with each other byusing a service-based interface, and the service-based interface is aresource-based capability exposure interface. A specific service-basedinterface may be a RESTful interface, a remote procedure call (RPC)interface, or the like.

The charging method according to an embodiment of this disclosure isdescribed below in detail with reference to the charging architectureshown in FIG. 4.

FIG. 5 is a schematic flowchart of a charging method according to anembodiment of this disclosure. The charging method includes thefollowing steps.

Step 501: A charging trigger apparatus sends a service resource createrequest to a charging system, wherein the service resource createrequest is used to request the charging system to create a serviceresource corresponding to a service in a session, the session is used toprovide a data connection service to user equipment, and the serviceresource is used to manage requesting for a quota for the service in thesession and/or manage reporting of usage information of the service inthe session.

It should be noted that when the charging method shown in FIG. 5 isapplied to the 5G network architecture shown in FIG. 3, the session maybe a packet data unit session (PDU session). The PDU session is asession between the user equipment and a data network, and is used toprovide a data connection service to the user equipment; or when thecharging method shown in FIG. 5 is applied to the 4G networkarchitecture shown in FIG. 2 the session may be a IP-connectivity accessnetwork session (IP-CAN session). The IP-CAN session is a sessionbetween the user equipment and a P-GW and is used to provide a dataconnection service to the user equipment.

Specifically, in this embodiment of this disclosure, the chargingtrigger apparatus may he triggered, in the following manner, to send theservice resource create request to the charging system: The chargingtrigger apparatus sends, according to a charging policy, the serviceresource create request to the charging system. The charging policy mayhe a local charging policy of the charging trigger apparatus, or may hesent by a charging policy apparatus to the charging trigger apparatus.For example, in the network architecture shown in FIG. 2, the chargingpolicy apparatus may be the PCRF; or in the network architecture shownin FIG. 3, the charging policy apparatus may be a policy controlfunction (PCF). For example, when the charging trigger apparatus needsto request a quota for the service in the session or report usageinformation of the service in the session and there is no availableservice resource, the charging trigger apparatus sends the serviceresource create request to the charging system. For another example,when the charging trigger apparatus determines to create a new session,and the session includes a service for which charging needs to beperformed, the charging trigger apparatus sends the service resourcecreate request to the charging system.

Step 502: After receiving the service resource create request sent bythe charging trigger apparatus, the charging system sends a serviceresource create response to the charging trigger apparatus, where theservice resource create response includes a first resource identifier,and the first resource identifier is used to identify the serviceresource that corresponds to the service in the session and that iscreated by the charging system.

In this embodiment of this disclosure, to help the charging systemdistinguish among service resources created for different sessions ofdifferent users, optionally, the service resource create requestincludes a session identifier and a user identifier corresponding to theuser equipment, and the session identifier is used to identify thesession. For example, if the session is a PDU session, the sessionidentifier is an identifier (ID) of the PDU session. The user identifiermay be an international mobile subscriber identity (IMSI), a user number(such as a mobile station international ISDN number (MSISDN)), a userinternet protocol version 6 (IPv6) address, or the like.

The service resource create request is specifically described below.

Case 1: One service resource create request corresponds to one serviceresource, and the one service resource corresponds to one session.

In Case 1, the charging trigger apparatus sends a service resourcecreate request to the charging system for one session, where the serviceresource create request is used to request the charging system to createa first service resource, and the first service resource corresponds toall services in the session. Specifically, all the services in thesession are online charging services; or all the services in the sessionare offline charging services; or all the services in the sessioninclude both an online charging service and an offline charging service.

For example, in the network architecture shown in FIG. 3, assuming thatthere are three PDU sessions between the user equipment and the SMFentity, the charging trigger apparatus sends service resource createrequests to the charging system for the three PDU sessions. To enablethe charging system to distinguish among the different service resourcecreate requests, each service resource create request includes a useridentifier and a PDU session ID.

Case 2: One service resource create request corresponds to two serviceresources, wherein one service resource corresponds to an onlinecharging service in a session, and the other service resourcecorresponds to an offline charging service in the session.

In Case 2, the charging trigger apparatus sends a service resourcecreate request to the charging system for one session. The serviceresource create request is used to request the charging system to createa second service resource and a third service resource, wherein thesecond service resource corresponds to an online charging service in thesession, and the third service resource corresponds to an offlinecharging service in the session.

During specific implementation, the charging system may identify thesecond service resource and the third service resource by usingdifferent resource identifiers.

Case 3: When the services in the session include an online chargingservice and an offline charging service, the charging trigger apparatussends two service resource create requests to the charging system,wherein one service resource create request is used to request thecharging system to create a service resource corresponding to the onlinecharging service in the session, and the other service resource createrequest is used to request the charging system to create a serviceresource corresponding to the offline charging service in the session.

It should be noted that in Case 3, different attribute or identifierinformation may be used, so that the charging system can distinguishbetween the service resource create request used to request the chargingsystem to create the service resource corresponding to the onlinecharging service in the session and the service resource create requestused to request the charging system to create the service resourcecorresponding to the offline charging service in the session.

Case 4: One service resource create request corresponds to a pluralityof service resources, and the plurality of service resourcescorresponding to the service resource create request are serviceresources corresponding to services in one session.

A possible specific implementation is: The charging trigger apparatussends a service resource create request to the charging system theservice resource create request is used to create a plurality of serviceresources, and each service resource corresponds to a service, in thesession, that belongs to a same rating group. For example, if onesession includes a service belonging to a rating group 1 and a servicebelonging to a rating group 2, the charging trigger apparatus sends aservice resource create request for the session. The service resourcecreate request is used to request to create two service resources, oneservice resource corresponds to the rating group 1, and the otherservice resource corresponds to the rating group 2.

During specific implementation, the charging system may identify theservice resources by using different resource identifiers.

It should be noted that in this embodiment of this disclosure, theservice resource create request, without carrying any quota requestinformation or any reported usage information, may be used to create aservice resource, and the service resource is used to manage requestingfor a quota for the service in the session and/or manage reporting ofusage information of the service in the session. Specifically,requesting for a quota for an online charging service, reporting ofusage information of an offline charging service, or requesting for avirtual quota for an offline charging service is subsequently completedthrough a service resource update operation.

In addition, in this embodiment of this disclosure, when the servicecorresponding to the service resource that the charging system isrequested to create by the service resource create request includes anonline charging service, the service resource create request may furtherinclude quota request information for the online charging service and arating group corresponding to the quota request information.

In this embodiment of this disclosure, when the service corresponding tothe service resource that the charging system is requested to create bythe service resource create request includes an offline chargingservice, the service resource create request may further include arequested virtual quota for the offline charging service and a ratinggroup corresponding to the requested virtual quota; or when the servicecorresponding to the service resource that the charging system isrequested to create by the service resource create request includes anoffline charging service, the service resource create request mayfurther include usage information of the offline charging service and arating group corresponding to the usage information.

In this embodiment of this disclosure, the quota request information forthe online charging service and the rating group corresponding to thequota request information, the usage information of the offline chargingservice and the rating group corresponding to the usage information, andthe requested virtual quota for the offline charging service and therating group corresponding to the requested virtual quota, all of whichare carried in the service resource create request, are identified byusing different attributes or flags, so that the charging system candistinguish among them for processing.

The rating group is used to aggregate one or more services having a samecharging rate, to help the charging system perform rating.

For example, when the service corresponding to the service resource thatthe charging system is requested to create by the service resourcecreate request includes an online charging service and an offlinecharging service, optionally, the service resource create request mayfurther include quota request information for the online chargingservice and a rating group corresponding to the quota requestinformation, and usage information of the offline charging service and arating group corresponding to the usage information. The chargingtrigger apparatus may distinguish, by using different attribute or flaginformation, between the quota request information for the onlinecharging service and the rating group corresponding to the quota requestinformation, and the usage information of the offline charging serviceand the rating group corresponding to the usage information. Forexample, a specific implementation of the service resource createrequest is shown in Table 1:

TABLE 1 Service Resource Create Request { user ID//User identifier PDUID//Identifier of a session Resource info // { Rating group 1 unit(type, value)//Requested quota type and quota amount for an onlinecharging service type=1//Flag indicating that a quota is requested forthe online charging service } { Rating group 2 unit (type, value)//Usagetype and usage amount of an offline charging service type=0//Flagindicating that usage information of the offline charging service isreported  } }

For another example, the service resource create request implemented byusing a RESTful interface is shown in Table 2. In the service resourcecreate request, the attribute “serviceResource” indicates the serviceresource and “subscriber IMSI” indicates the user identifier.

TABLE 2 POST <server>/v1/<subscriber IMSI>/serviceResource Content-Type:application/json { “pdusessionID”: “023152120”,//Identifier of a session“serviceResource”:‘[{ “opType”:“Requested”,//Flag indicating that aquota is requested for an online charging service“ratingGroup”:“001”,//Rating group “unitType”:“volume”,//Requested quotatype “units”:“10”//Requested quota amount }, } “opType”:“Reported”,//Flag indicating that usage information of an offline charging serviceis reported “ratingGroup”:“002”,//Rating group“unitType”:“volume”,//Usage type of the offline charging service“units”:“25”//Usage amount of the offline charging service } } }

For example, when the service corresponding to the service resource thatthe charging system is requested to create by the service resourcecreate request includes an online charging service and an offlinecharging service, optionally, the service resource create request mayfurther include quota request information for the online chargingservice a rating group corresponding to the quota request information, arequested virtual quota for the offline charging service and a ratinggroup corresponding to the requested virtual quota. A specificimplementation of the service resource create request is shown in Table3:

TABLE 3 Service Resource Create Request{ user ID//User identifier PDUID//Identifier of a session Resource info  { Rating group 1 unit (type,value)//Requested quota type and quota amount for an online chargingservice type=1//Flag indicating that a quota is requested for the onlinecharging service  } { Rating group 2 unit (type, value)//Requestedvirtual quota type and quota amount for an offline charging servicetype=2//Flag indicating that a virtual quota is requested for theoffline charging service  } }

Specifically, for the request for a quota for the online chargingservice, that the charging system reserves, from account balance of theuser equipment, a quota that corresponds to the rating group and that isrequested by using the service resource create request, and allocatesthe quota to the online charging service may be applied to a case inwhich the service resource create request further includes the quotarequest information for the online charging service and the rating groupcorresponding to the quota request information. For another example, forthe request for a virtual quota for the offline charging service, thatthe charging system allocates, to the offline charging service, avirtual quota that corresponds to the rating group and that is requestedby using the service resource create request, without reserving thevirtual quota from account balance of the user equipment may be appliedto a case in which the service resource create request further includesthe requested virtual quota for the offline charging service and therating group corresponding to the requested virtual quota.Alternatively, for another example, that the charging system generates acharging data record, based on the usage information of the offlinecharging service and the rating group corresponding to the usageinformation may he applied to a case in which the service resourcecreate request further includes the usage information of the offlinecharging service and the rating group corresponding to the usageinformation.

For example, when the service resource create request is as shown inTable 2, the charging system reserves a quota of “10 M traffic volume”from the account balance for the online charging service whose useridentifier is the IMSI, session identifier is “023152120”, flag “opType”is “Requested”, and rating group is “001”; and generates a charging datarecord with the usage information “25 M traffic volume” for the offlinecharging service whose user identifier is the IMSI, session identifieris “023152120”, flag “opType” is “Reported”, and rating group is “002”.

It should be further noted that in this embodiment of this disclosure,the charging system may perform corresponding processing for the serviceresource create request according to a locally configured policy, or mayperform corresponding processing for the service resource create requestaccording to a configuration policy delivered by the charging policyapparatus such as the PCF.

In addition, if event-based charging needs to be performed for an eventor an event group of a service, the charging system creates, based on arequest of the charging trigger apparatus, a service resourcecorresponding to the event or the event group of the service, specifiesa validity period for the service resource, subtracts, from a useraccount, charges spent by the service, and generates a resourceidentifier. The resource identifier is used to identify the serviceresource. If the service fails, the charging trigger apparatus sends aservice resource delete request, and the service resource delete requestincludes the resource identifier and identification informationinstructing the charging system to return, to the user account, thecharges that are spent by the service corresponding to the serviceresource identified by the resource identifier and that are subtractedfrom the user account. If the service succeeds, the charging triggerapparatus does not need to send the service resource delete request, andafter the validity period expires, the charging system automaticallydeletes the service resource.

In this embodiment of this disclosure, in step 502, the service resourcecreate response sent by the charging system to the charging triggerapparatus may further include a user identifier and a sessionidentifier, so that the charging trigger apparatus can distinguish amongservices corresponding to the service resource identified by the firstservice resource identifier.

It should be noted that when the charging system has granted the quotato the online charging service, or has granted the virtual quota to theoffline charging service, the service resource create response mayfurther include granted quota information or granted virtual quotainformation.

During specific implementation, the quota granted to the online chargingservice and the virtual quota granted to the offline charging servicecorrespond to different attribute or flag information in the responsemessage, so that the charging trigger apparatus can distinguish betweenthem.

Optionally, the charging system may further generate a re-authenticationtrigger condition, and send the re-authentication trigger condition tothe charging trigger apparatus, so that the charging trigger apparatusreports corresponding information when the re-authentication triggercondition is met. A specific re-authentication trigger condition maycorrespond to the service resource, or may correspond to a servicecorresponding to the service resource. The re-authentication triggercondition may alternatively be sent to the charging trigger apparatus byusing the service resource create response. For example, there-authentication trigger condition is that a usage amount of the onlinecharging service is greater than or equal to the quota granted to theonline charging service, or that the session is interrupted.

In addition, for the quota request information sent by the chargingtrigger apparatus, the charging system may further determine whether togrant the quota or whether to allow user equipment to directly use theservice without any quota granted. If a determining result is that theservice is an offline charging service that can be directly used withoutany quota granted, the service resource create response may furtherinclude an indication indicating that no granting needs to be performed.When the service, in the session, that belongs to a same rating group,corresponds to one service resource, if the charging system determinesthat the same rating group corresponds to both an actual quota and avirtual quota, the service resource create response further carries flowinformation corresponding to the granted quota (for example, a flowidentifier or a flow feature information of the quota), so that thecharging trigger apparatus separately manages, for the same rating groupbased on the flow identifier or the flow information, use of the actualquota and the virtual quota that are granted by the charging system.

For example, the service resource create response may be shown in Table4.

TABLE 4 Service Resource Create Response{ userID//User identifierResource ID//Service resource identifier Resource Info//Granted quotainformation  { Rating group 1//Rating group unit (type, value)//Grantedquota type and quota amount resource update trigger//Re-authenticationtrigger condition type=1//Flag indicating that a quota is granted for anonline charging service  } { Rating group 2//Rating group unit (type,value)//Granted virtual quota type and quota amount type=2//Flagindicating a virtual quota is granted for an offline charging serviceresource update trigger//Re-authentication trigger condition  } }

In another example, the service resource create response is shown inTable 5.

TABLE 5 200 Content-Type: application/json { “id”:“7b7181ae547aac1e01547efb61f20162”, //Service resource identifier“resultCode”: “”,//Response information “resourceTimeOut”: “”,//Resourceexpiration time “serviceResource”:‘[{ “opType”:“Granted”,//Flagindicating that a quota is granted “ratingGroup”:“001”,//Rating group“unitType”:“volume”,//Granted quota type “units”:“10”,//Granted quotaamount “triggers”:[{ “triggerType”:“”//Re-authentication triggercondition } ] } ] }

It should be further noted that optionally, in this embodiment of thisdisclosure, if the charging system fails to create the service resource,the charging system sends a response indicating that the serviceresource fails to be created, to notify the charging trigger apparatusthat the service resource fails to be created. In this case, to ensuresuccessful use and charging of the service, the charging triggerapparatus may reseed the service resource create request to anothercharging system.

In addition, to ensure successful use of the service by the user andaccuracy of charging for the service, the charging trigger apparatussends a service resource update request to the charging system, theservice resource update request includes a second resource identifier,and the second resource identifier is used to identify a serviceresource, in the service resource identified by the first resourceidentifier, that the charging system is requested to update. Afterreceiving the service resource update request sent by the chargingtrigger apparatus, the charging system correspondingly updates theservice resource based on the service resource update request.

It should he noted that the second resource identifier may be the firstresource identifier, or may be an identifier of part of the resourceidentified by first resource identifier. Specifically, whether thesecond resource identifier is the first resource identifier or anidentifier of part of the resource identified by first resourceidentifier may be determined by the charging system based on an actualcase. For example, the first resource includes a service resourceidentified by a resource identifier 1 and a service resource identifiedby a resource identifier 2, if the service resource identified by theresource identifier 2 needs to be updated while the service resourceidentified by the resource identifier 1 remains unchanged, the secondresource identifier is the resource identifier 2. For another example,when the first resource identifier is used to identify one serviceresource, and the service resource identified by the first resourceidentifier needs to be updated, the second resource identifier is thefirst resource identifier.

It should he understood that, during specific implementation, in example1: when the service corresponding to the service resource identified bythe second resource identifier includes an online charging service, theservice resource update request may further include quota requestinformation for the online charging service, a rating groupcorresponding to the quota request information, usage information of theonline charging service and a rating group corresponding to the usageinformation. In this case, after receiving the service resource updaterequest, the charging system may further reserve, from account balanceof the user equipment, a quota that corresponds to the rating group andthat is requested by using the service resource create request,allocates the quota to the online charging service, and subtract, fromthe quota allocated to the online charging service based on the usageinformation of the online charging service and the rating groupcorresponding to the usage information, a part used by the onlinecharging service. Such technical solution may he applied to a case inwhich the granted quota of the online charging service in the session isused up.

In example 2, when the service corresponding to the service resourceidentified by the second resource identifier includes an online chargingservice, the service resource update request may further include quotarequest information for the online charging service and a rating groupcorresponding to the quota request information. In this case, afterreceiving the service resource update request, the charging system mayfurther reserve, from account balance of the user equipment, a quotathat corresponds to the rating group and that is requested by using theservice resource create request, and allocates the quota to the onlinecharging service. Such technical solution may be applied to a case inwhich there is anew online charging service having no granted quota inthe session.

In example 3, when the service corresponding to the service resourceidentified by the second resource identifier includes an online chargingservice, the service resource update request may further include usageinformation of the online charging service and a rating groupcorresponding to the usage information. In this case, after receivingthe service resource update request, the charging system may furthersubtract a part used by the online charging service from a quotaallocated to the online charging service. Such technical solution may beapplied to a case in which the granted quota of the online chargingservice in the session is not used up.

In example 4, when the service corresponding to the service resourceidentified by the second resource identifier includes an offlinecharging service, the service resource update request may furtherinclude a requested virtual quota for the offline charging service, arating group corresponding to the requested virtual quota, usageinformation of the offline charging service and a rating groupcorresponding to the usage information. In this case, after receivingthe service resource update request, the charging system may furtherallocate, to the offline charging service, a virtual quota thatcorresponds to the rating group and that is requested by using theservice resource create request, and generate a charging data recordbased on the usage information of the offline charging service and therating group corresponding to the usage information. Such technicalsolution may be applied to a case in which the granted virtual quota ofthe offline charging service in the session is used up.

In example 5, when the service corresponding to the service resourceidentified by the second resource identifier includes an offlinecharging service, the service resource update request may furtherinclude a requested virtual quota for the offline charging service and arating group corresponding to the requested virtual quota. In this case,after receiving the service resource update request, the charging systemmay further allocate, to the offline charging service, a virtual quotathat corresponds to the rating group and that is requested by using theservice resource create request. Such technical solution may he appliedto a case in which there is a new offline charging service having nogranted virtual quota in the session.

In example 6, when the service corresponding to the service resourceidentified by the second resource identifier includes an offlinecharging service, the service resource create request may furtherinclude usage information of the offline charging service and a ratinggroup corresponding to the usage information. In this case, afterreceiving the service resource update request, the charging system mayfurther generate a charging data record based on the usage informationof the offline charging service and the rating group corresponding tothe usage information. Such technical solution may be applied to a casein which there is an offline charging service in the session.

It should be noted that technical solutions of example 1, example 2,example 3, example 4, example 5, and example 6 may be used together, andoptionally, when the technical solution of example 6 is used, technicalsolutions of example 4 and example 5 may be interchanged for use, or thetechnical solution of example 4 may be interchanged for use, or thetechnical solution of example 5 may be interchanged for use.

In this embodiment of this disclosure, the quota request information forthe online charging service and the rating group corresponding to thequota request information, the usage information of the online chargingservice and the rating group corresponding to the usage information ofthe online charging service, the usage information of the offlinecharging service and the rating group corresponding to the usageinformation of the offline charging service, and the requested virtualquota for the offline charging service and the rating groupcorresponding to the requested virtual quota, all of which are carriedin the service resource create request, are identified by usingdifferent attribute or flag information, so that the charging system candistinguish among them for processing.

In addition, when the service resource update request includes the usageinformation (such as the usage information of the online chargingservice or the usage information of the offline charging service) of theservice, the service resource update request may further include areason fir reporting the usage information of the service, for example,the granted quota of the online charging service is used up, or thesession is interrupted.

Specifically, when the service resource update request includesinformation such as the quota request information for the service or theusage information of the service, the information may be carried in auniform resource locator (URL) of the service resource update request,or may be carried in a message header of the service resource updaterequest, or may be carried in a message body of the service resourceupdate request. The place where the information is carried is notlimited in this disclosure.

In an example, a specific implementation of the service resource updaterequest may be shown in Table 6.

TABLE 6 Service Resource Update Request { userID//User identifierresource ID//Second resource identifier resource info { Rating group1//Rating group unit (type, value)//Usage type and usage amount of anonline charging service type=3//Flag indicating that usage informationof the online charging service is reported }  { Rating group 1//Ratinggroup unit (type, value)//Quota type and quota amount type=1//Flagindicating that a new quota is requested for a charging service  }  {Rating group 1//Rating group unit (type, value)//Usage type and usageamount of an offline charging service type=0//Flag indicating that usageinformation of the offline charging service is reported  } }

For another example, the service resource update request implemented byusing the RESTful interface is shown in Table 7. In the service resourceupdate request, the attribute “serviceResource” indicates the serviceresource and “subscriber” indicates a user.

TABLE 7 PATCH <server>/v1/subscriber/serviceResource/<Resource id>Content-Type: application/json { “serviceResource”:‘[{“opType”:“Used”,//Flag indicating that uage information of an onlinecharging service is reported “ratingGroup”:“001”,//Rating group“unitType”;“volume”,//Usage type of an online charging service“units”:“8”//Usage amount of the online charging service }, {“opType”:“VirtualUsed”,//Flag indicating that usage information of anoffline charging service with a virtual quota granted is reported“ratingGroup”:“001”,//Rating group “unitType”:“volume”,//Usage type ofan offline charging service “units”:“8”//Usage amount of the offlinecharging service }, { “opType”:“Requested”,//Flag indicating that a newquota is requested for the online charging service“ratingGroup”:“001”,//Rating group “unitType”:“volume”,//Quota type“units”:“10”,//Quota amount “reportingReason”:“”//Reason for reporting}, { “opType”:“Reported”,//Flag indicating that usage information of anoffline charging service is reported “ratingGroup”:“002”,//Rating group“unitType”:“volume”,//Usage type of an offline charging service“units”:“10”//Usage amount of the offline charging service } ] }

Specifically, this embodiment of this disclosure further provides amanner of triggering the charging trigger apparatus to send the serviceresource update request to the charging system:

A possible triggering manner is: When a first trigger condition is met,the charging trigger apparatus sends the service resource update requestto the charging system. For example, the first charging triggercondition may be that the charging trigger apparatus determines that thequota granted to the online charging service is used up. For anotherexample, the first charging trigger condition is the re-authenticationcondition delivered by the charging system. For still another example,the first charging trigger condition is that a status of the servicesatisfies a preconfigured reporting condition (for example, the serviceis ended or a network type is changed).

Another possible trigger manner is: The charging system sends a serviceresource update notification to the charging trigger apparatus, thenotification includes a third resource identifier, and the thirdresource identifier is used to identify a service resource, in theservice resource identified by the first resource identifier, that thecharging system requests to be updated. After receiving the serviceresource update notification, the charging trigger apparatus reports theservice resource update request to the charging system. The serviceresource update request includes the second resource identifier, and thesecond resource identifier may be the third resource identifier; or mayinclude the third service resource identifier and an identifier ofanother to-be-updated service resource determined by the chargingtrigger apparatus.

Further, the service resource update notification further includes arating group to which a service for which the charging system requests aservice resource to be updated belongs, and the service is in theservices corresponding to a service resource identified by the thirdresource identifier.

For example, a possible implementation of the service resource updatenotification is shown in Table 8.

TABLE 8 Service Resource Update Notify. { userID//User identifierresource ID//Resource identifier Rating group 1 }

For example, the service resource update notification implemented byusing the RESTful interface is shown in Table 9, the attribute“subscriber” indicates the user and “pdusessionID” indicates the sessionidentifier.

TABLE 9 POST <server>/v1/subscriber/<pdusessionID> Content-Type:application/json {“relatedServiceResource”:“7b7181ae547aac1e01547efb61f20162”//Resourceidentifier “ratingGroup”:“”,//Rating group }

In this embodiment of this disclosure, after updating the correspondingservice resource based on the service resource update request, thecharging system may further return a service resource update response tothe charging trigger apparatus. Specifically, the service resourceupdate response is used to indicate, to the charging trigger apparatus,whether the charging system has updated the service resource.

Optionally, the service resource update response may further includeinformation such as the quota granted to the online charging service orthe virtual quota granted to the offline charging service. When theservice resource update response includes bath the quota granted to theonline charging service and the virtual quota granted to the offlinecharging service, the quota granted to the online charging service andthe virtual quota granted to the offline charging service correspond todifferent flags or attributes, so that the charging trigger apparatuscan distinguish between them.

In an example, a possible implementation of the service resource updateresponse may be shown in Table 10.

TABLE 10 Service Resource Update Response{ userID//User identifierresource ID//Resource identifier resource info { Rating group 1 unit(type, value)//Granted quota type and quota amount type=3//Flagindicating that a quota is granted for an online charging service } }

For another example, the service resource update response implemented byusing the RESTful interface is shown in Table 11. In the serviceresource update response, the attribute “serviceResource” indicates theservice resource and “subscriber” indicates the user.

TABLE 11 200 Content-Type: application/json { “id”:“7b7181ae547aac1e01547efb61f20162”,//Service resource identifier“resultCode”: “”,//Response information “serviceResource”:‘[{ “opType”:“Granted”,//Flag indicating that a quota is granted for an online service“ratingGroup”:“001”,//Rating group “unitType”:“volume”,//Granted quotatype “units”:“8”//Granted quota amount } ] }

To improve resource utilization ratio in the charging system,optionally, when a second charging trigger condition is met, thecharging trigger apparatus sends a service resource delete request tothe charging system, the service resource delete request includes afourth resource identifier, and the fourth resource identifier is usedto identify a service resource to be deleted from the service resourceidentified by the first resource identifier. After receiving the serviceresource delete request, the charging system deletes the serviceresource identified by the fourth resource identifier.

It should be noted that the second charging trigger condition may besent by the charging policy apparatus to the charging trigger apparatus,or may be a policy configured by the charging trigger apparatus locally.For example, the second charging trigger condition is that a servicecorresponding to the service resource is interrupted, or the session isended.

During specific implementation, when the service corresponding to theservice resource identified by the fourth resource identifier includesan online charging service, the service resource delete request mayfurther include usage information of the online charging service and arating group corresponding to the usage information. In this case, thecharging system subtracts, from a quota for the online charging servicebased on the usage information of the online charging service and therating group corresponding to the usage information, a part used by theonline charging service. Such subtraction may be applied to a case inwhich the service resource delete request further includes the usageinformation of the online charging service and the rating groupcorresponding to the usage information. When the service correspondingto the service resource identified by the fourth resource identifierincludes an offline charging service, the service resource deleterequest may further include usage information of the offline chargingservice and a rating group corresponding to the usage information. Inthis case, the charging system generates a charging data record based onthe usage information of the offline charging service and the ratinggroup corresponding to the usage information, and such technicalsolution may be applied to a case in which the service resource deleterequest further includes the usage information of the offline chargingservice and the rating group corresponding to the usage information.

When the service resource delete request includes usage information of aservice (such as usage information of an online charging service orusage information of an offline charging service) the service resourcedelete request may include a reason for reporting the usage informationof the service.

Specifically, the foregoing content may he carried in a URL of theservice resource delete request, or may be carried in a message; headerof the service resource; delete request, or may be carried in a messagebody of the service resource delete request.

It should be understood that, different content, such as the usageinformation of the online charging service or the usage information ofthe offline charging service, included in the service resource deleterequest may be identified by using different or flag information, sothat the charging system can distinguish among them for processing.

Alternatively, when a service resource corresponding to an onlinecharging service is different from a service resource corresponding toan offline charging service, different service resource delete requestsmay be used to request the charging system to delete the serviceresource corresponding to the online charging service and the serviceresource corresponding to the offline charging service. In the case whena service resource delete request includes usage information of aservice, usage information of an online charging service and usageinformation of an offline charging service may be carried in differentservice resource delete requests.

In an example, a possible implementation of the service resource deleterequest may be shown in Table 12.

TABLE 12 Service Resouce Delete Request { userID resource ID resourceinfo { Rating group 1 unit (type, value)//Usage type and usage amounttype=3//Flag indicating that usage information of an online chargingservice with a quota granted is reported }  {// Rating group 2 unit(type, value)//Usage type and usage amount type=0//Flag indicating thatusage information of an offline charging service is reported  } }

For another example, the service resource delete request implemented byusing the RESTful interface is shown in Table 13. In the serviceresource delete request, the attribute “serviceResource” indicates theservice resource and “subscriber” indicates the user.

TABLE 13 DELETE <server>/v1/subscriber/serviceResource/<Resource id>Content-Type: application/json { “serviceResource”:‘[{“opType”:“Used”,//Flag indicating that usage information information ofan online charging service with a quota granted is reported“ratingGroup”:“001”,//Rating group “unitType”:“volume”,//Used quota type“units”:“8”//Used quota amount “reportingReason”:“”//Reason forreporting }, { “opType”:“Reported”,//Flag indicating that usageinformation of an offline charging service is reported“ratingGroup”:“002”,//Rating group “unitType”:“volume”,//Usage type“unite”:“10”//Usage amount “reportingReason”:“”//Reason for reporting }] }

In this embodiment of this disclosure, after the charging system deletesthe service resource based on the service resource delete request,optionally, the charging system may further send a service resourcedelete response to the charging trigger apparatus, and the serviceresource delete response is used to notify the charging triggerapparatus of the deleted service resource.

In embodiments of this disclosure, different messages, such as theservice resource create request, the service resource update request,and the service resource delete request, may be distinguished by a nameof a hypertext transfer protocol (HTTP) method, a name of an applicationprogramming interface (API), a specific identifier in an API, or thelike, used by an application.

The solutions provided in this disclosure are mainly described abovefrom a perspective of interaction between network elements. It can beunderstood that, to implement the foregoing functions, the networkelements include corresponding hardware structures and/or softwaremodules for performing the functions. A person of ordinary skill in theart should easily be aware that, in combination with the example units,algorithms, and steps described in the embodiments disclosed in thisdisclosure, this disclosure may be implemented by using hardware or acombination of hardware and computer software. Whether a function isperformed by hardware or hardware driven by computer software depends onparticular applications and design constraints of the technicalsolutions. A person skilled in the art may use different methods toimplement the described functions for each particular application, butit should not be considered that the implementation goes beyond thescope of this disclosure.

Based on a same concept, FIG. 6 is a schematic diagram of a chargingtrigger apparatus 600 according to this disclosure. The charging triggerapparatus may be a network device, or may be a chip or a system on chipin a network device, and may perform the method performed by thecharging trigger apparatus in the embodiment shown in FIG. 5.

The charging trigger apparatus 600 includes at least one processor 610and a memory 630.

The memory 630 is configured to store a program. The memory 630 may be aROM, another type of static storage device, such as a RAM, that canstore static information and an instruction, or another type of dynamicstorage device that can store information and an instruction; or may bean electrically erasable programmable read-only memory (EEPROM), acompact disc read-only memory (CD-ROM) or another compact disc storage,a disc storage (including a compact disc, a laser disc, an optical disc,a digital versatile disc, a Blu-ray disc, or the like), a magnetic diskstorage medium or another magnetic disk storage device, or any othermedium that can be configured to carry or store an expected program in aform of an instruction or a data structure and that can be accessed by acomputer. However, this disclosure is not limited thereto. The memory630 may exist independently and is connected to the processor 610.Alternatively, the memory 630 may be integrated with the processor 610.

The processor 610 is configured to execute the program in the memory630, to implement the steps performed by the charging trigger apparatusin the charging method in the embodiments of this disclosure. Forrelated features, refer to the foregoing descriptions, and details arenot described herein again. For example, the processor 610 may be ageneral-purpose CPU, a microprocessor, an ASIC, or one or moreintegrated circuits that are configured to control execution of theprogram of the technical solutions of this disclosure.

During specific implementation, in an embodiment, the processor 610 mayinclude one or more CPUs, for example, a CPU 0 and a CPU 1 in FIG. 6.

During specific implementation, in an embodiment, the charging triggerapparatus 600 may include a plurality of processors, for example, aprocessor 610 and a processor 611 in FIG. 6. Each of the processors maybe a single-core (single-CPU) processor, or may he a multi-core(multi-CPU) processor. The processor herein may be one or more devices,a circuit, and/or a processing core configured to process data (forexample, a computer program instruction).

Optionally, when the charging trigger apparatus 600 is a terminaldevice, the charging trigger apparatus 600 may further include atransceiver 620 shown in FIG. 6, the transceiver 620 is configured tocommunicate with another device or a communications network, and thetransceiver 620 includes a radio frequency circuit. In the terminaldevice, the processor 610, the transceiver 620, and the memory 630 maybe connected by using a communications bus. The communications bus mayinclude a path for information transmission between the foregoing units.When the charging trigger apparatus 600 is a chip or a system on chip ina network device, the processor 610 may send or receive data by using aninput/output interface, a pin, a circuit, or the like.

FIG. 7 is a schematic diagram of another charging trigger apparatusaccording to an embodiment of this disclosure. The apparatus may he anetwork device, or may be a chip or a system on chip in a networkdevice, and may perform the method performed by the charging triggerapparatus in the embodiment shown in FIG. 5.

The apparatus includes a processing unit 701 and a communications unit702.

The processing unit 701 is configured to generate a service resourcecreate request; and the communications unit 702 is configured to: sendthe service resource create request to a charging system, and thenreceive a service resource create response sent by the charging system.The service resource create request is used to request the chargingsystem to create a service resource corresponding to a service in asession, the session is used to provide a data connection service touser equipment, the service resource is used to manage requesting for aquota for the service in the session and/or manage reporting of usageinformation of the service in the session, the service resource createresponse includes a first resource identifier, and the first resourceidentifier is used to identify the service resource that corresponds tothe service in the session and that is created by the charging system.

Optionally, when a quota needs to be requested or usage informationneeds to be reported for the service in the session and there is noavailable service resource, the communications unit 702 is configured tosend the service resource create request to the charging system.

Optionally, the service resource create request includes a sessionidentifier and a user identifier corresponding to the user equipment,and the session identifier is used to identify the session.

Optionally, the service resource create request is used to request thecharging system to create a first service resource, and the firstservice resource corresponds to all services in the session. All theservices in the session are online charging services; or all theservices in the session are offline charging services; or all theservices in the session include an online charging service and anoffline charging service.

Optionally, the service resource create request is used to request thecharging system to create a second service resource and a third serviceresource, where the second service resource corresponds to an onlinecharging service in the session, and the third service resourcecorresponds to an offline charging service in the session.Alternatively, in a possible design, the service resource create requestis used to request the charging system to create a service resourcecorresponding to an online charging service in the session.Alternatively, in a possible design, the service resource create requestis used to request the charging system to create a service resourcecorresponding to an offline charging service in the session.

Optionally, the service resource create request is used to request thecharging system to create at least one service resource, and each of theat least one service resource corresponds to a service, in the session,that belongs to a same rating group.

Optionally, when the service corresponding to the service resource thatthe charging system is requested to create by the service resourcecreate request includes an online charging service, the service resourcecreate request further includes quota request information for the onlinecharging service and a rating group corresponding to the quota requestinformation; or

when the service corresponding to the service resource that the chargingsystem is requested to create by the service resource create requestincludes an offline charging service, the service resource createrequest further includes a requested virtual quota for the offlinecharging service and a rating group corresponding to the requestedvirtual quota; or when the service corresponding to the service resourcethat the charging system is requested to create by the service resourcecreate request includes an offline charging service, the serviceresource create request further includes usage information of theoffline charging service and a rating group corresponding to the usageinformation.

Optionally, the communications unit 702 is further configured to send aservice resource update request to the charging system. The serviceresource update request includes a second resource identifier, and thesecond resource identifier is used to identify a service resource, inthe service resource identified by the first resource identifier, thatthe charging system is requested to update.

Optionally, when the service corresponding to the service resourceidentified by the second resource identifier include an online chargingservice, the service resource update request further includes quotarequest information for the online charging service, a rating groupcorresponding to the quota request information, usage information of theonline charging service and a rating group corresponding to the usageinformation; or when the service corresponding to the service resourceidentified by the second resource identifier include an online chargingservice, the service resource update request further includes quotarequest information for the online charging service and a rating groupcorresponding to the quota request information; or when the servicecorresponding to the service resource identified by the second resourceidentifier includes an online charging service, the service resourceupdate request further includes usage information of the online chargingservice and a rating group corresponding to the usage information; or

when the service corresponding to the service resource identified by thesecond resource identifier includes an offline charging service, theservice resource update request further includes a requested virtualquota for the offline charging service, a rating group corresponding tothe requested virtual quota, usage information of the offline chargingservice and a rating group corresponding to the usage information; orwhen the service corresponding to the service resource identified by thesecond resource identifier includes an offline charging service, theservice resource update request further includes a requested virtualquota for the offline charging service and a rating group correspondingto the requested virtual quota; or when the service corresponding to theservice resource identified by the second resource identifier includesan offline charging service, the service resource update request furtherincludes usage information of the offline charging service and a ratinggroup corresponding to the usage information.

Optionally, the communications unit 702 is configured to: afterreceiving a service resource update notification sent by the chargingsystem, send the service resource update request to the charging system.Optionally, the service resource update notification includes a thirdresource identifier, and the third resource identifier is used toidentify a service resource, in the service resource identified by thefirst resource identifier, that the charging system requests to beupdated.

Further, optionally, the service resource update request furtherincludes a rating group to which a service for which the charging systemrequests a service resource to be updated belongs, and the service is inthe services corresponding to a service resource identified by the thirdresource identifier.

Optionally, the communications unit 702 is configured to send theservice resource update request to the charging system.

Optionally, the communications unit 702 is further configured to send aservice resource delete request to the charging system. The serviceresource delete request includes a fourth resource identifier, and thefourth resource identifier is used to identify a service resource to bedeleted from the service resource identified by the first resourceidentifier.

Optionally, when the service corresponding to the service resourceidentified by the fourth resource identifier includes an online chargingservice, the service resource delete request further includes usageinformation of the online charging service and a rating groupcorresponding to the usage information; or when the servicecorresponding to the service resource identified by the fourth resourceidentifier includes an offline charging service, the service resourcedelete request further includes usage information of the offlinecharging service and a rating group corresponding to the usageinformation.

It should be understood that the charging trigger apparatus may beconfigured to implement the steps performed by the charging triggerapparatus in the charging method in the embodiments of this disclosure.For related features, refer to the foregoing descriptions, and detailsare not described herein again.

Based on a same concept, FIG. 8 is a schematic diagram of a chargingsystem 800 according to this disclosure. The charging system may be anetwork device, or may be a chip or a system on chip in a networkdevice, and may perform the method performed by the charging system inthe embodiment shown in FIG. 5.

The charging system 800 includes at least one processor 810 and a memory830.

The memory 830 is configured to store a program. The memory 830 may be aROM, another type of static storage device, such as a RAM, that canstore static information and an instruction, or another type of dynamicstorage device that can store information and an instruction; or may bean EEPROM, a CD-ROM or another compact disc storage, a disc storage(including a compact disc, a laser disc, an optical disc, a digitalversatile disc, a Blu-ray disc, or the like), a magnetic disk storagemedium or another magnetic disk storage device, or any other medium thatcan be configured to carry or store an expected program in a form of aninstruction or a data structure and that can be accessed by a computer.However, this disclosure is not limited thereto. The memory 830 mayexist independently and is connected to the processor 810.Alternatively, the memory 830 may be integrated with the processor 810.

The processor 810 is configured to execute the program in the memory830, to implement the steps performed by the charging system in thecharging method in the embodiments of this disclosure. For relatedfeatures, refer to the foregoing descriptions, and details are notdescribed herein again. For example, the processor 810 may be ageneral-purpose CPU, a microprocessor, an ASIC, or one or moreintegrated circuits that are configured to control execution of theprogram of the technical solutions of this disclosure.

During specific implementation, in an embodiment, the processor 810 mayinclude one or more CPUs, for example, a CPU 0 and a CPU 1 in FIG. 8.

During specific implementation, in an embodiment, the charging systemcommunications apparatus 800 may include a plurality of processors, forexample, a processor 810 and a processor 811 in FIG. 8. Each of theprocessors may be a single-core (single-CPU) processor, or may be amulti-core (multi-CPU) processor. The processor herein may be one ormore devices, a circuit, and/or a processing core configured to processdata (for example, a computer program instruction).

Optionally, when the charging system 800 is a network device, thecharging system 800 may further include a transceiver 820 shown in FIG.8, the transceiver 820 is configured to communicate with another deviceor a communications network, and the transceiver 820 includes a radiofrequency circuit. In the network device, the processor 810, thetransceiver 820, and the memory 830 may be connected by using acommunications bus. The communications bus may include a path forinformation transmission between the foregoing units. When the chargingsystem 800 is a chip or a system on chip in a network device, theprocessor 810 may send or receive data by using an input/outputinterface, a pin, a circuit, or the like.

FIG. 9 is a schematic diagram of another charging system according to anembodiment of this disclosure. The charging system may be a networkdevice, or may be a chip or a system on chip in a network device, andmay perform the method performed by the charging system in theembodiment shown in FIG. 5.

The charging system includes a processing unit 901 and a communicationsunit 902.

The communications unit 902 is configured to receive a service resourcecreate request sent by a charging trigger apparatus; then the processingunit 901 is configured to: after the communications unit 902 receivesthe service resource create request, generate a service resource createresponse; and the communications unit 902 is further configured to sendthe service resource create response to the charging trigger apparatus.The service resource create request is used to request the chargingsystem to create a service resource corresponding to a service in asession, the session is used to provide a data connection service touser equipment, and the service resource is used to manage requestingfor a quota for the service in the session and/or manage reporting ofusage information of the service in the session. The service resourcecreate response includes a first resource identifier, and the firstresource identifier is used to identify the service resource thatcorresponds to the service in the session and that is created by thecharging system.

Optionally, the service resource create request includes a sessionidentifier and a user identifier corresponding to the user equipment,and the session identifier is used to identify the session. Thistechnical solution helps the charging system be able to distinguishamong different types of services of different users when performingservice charging.

Optionally, the service resource create request is used to request thecharging system to create a first service resource, and the firstservice resource corresponds to all services in the session. All theservices in the session are online charging services; or all theservices in the session are offline charging services; or all theservices in the session include an online charging service and anoffline charging service.

Optionally, the service resource create request is used to request thecharging system to create a second service resource and a third serviceresource, where the second service resource corresponds to an onlinecharging service in the session, and the third service resourcecorresponds to an offline charging service in the session.Alternatively, in a possible design, the service resource create requestis used to request the charging system to create a service resourcecorresponding to an online charging service in the session.Alternatively, in a possible design, the service resource create requestis used to request the charging system to create a service resourcecorresponding to an offline charging service in the session.

Optionally, the service resource create request is used to request thecharging system to create at least one service resource, and each of theat least one service resource corresponds to a service, in the session,that belongs to a same rating group.

Optionally, when the service corresponding to the service resource thatthe charging system is requested to create by the service resourcecreate request includes an online charging service, the service resourcecreate request further includes quota request information for the onlinecharging service and a rating group corresponding to the quota requestinformation; or

when the service corresponding to the service resource that the chargingsystem is requested to create by the service resource create requestincludes an offline charging service, the service resource createrequest further includes a requested virtual quota for the offlinecharging service and a rating group corresponding to the requestedvirtual quota; or when the service corresponding to the service resourcethat the charging system is requested to create by the service resourcecreate request includes an offline charging service, the serviceresource create request further includes usage information of theoffline charging service and a rating group corresponding to the usageinformation.

Optionally, the communications unit 902 is further configured to receivea service resource update request sent by the charging triggerapparatus, and the processing unit 901 is further configured to update,based on the service resource update request, a service resourcecorresponding to a second resource identifier. The service resourceupdate request includes the second resource identifier, and the secondresource identifier is used to identify a service resource, in theservice resource identified by the first resource identifier, that thecharging system is requested to update. This technical solution helpsfurther improve accuracy of service charging performed by the chargingsystem.

Optionally, when the service corresponding to the service resourceidentified by the second resource identifier includes an online chargingservice, the service resource update request further includes quotarequest information for the online charging service, a rating groupcorresponding to the quota request information, usage information of theonline charging service and a rating group corresponding to the usageinformation; or when the service corresponding to the service resourceidentified by the second resource identifier includes an online chargingservice, the service resource update request further includes quotarequest information for the online charging service and a rating groupcorresponding to the quota request information; or when the servicecorresponding to the service resource identified by the second resourceidentifier includes an online charging service, the service resourceupdate request further includes use information of the online chargingservice and a rating group corresponding to the online charging service;

when the service corresponding to the service resource identified by thesecond resource identifier includes an offline charging service, theservice resource update request further includes a requested virtualquota for the offline charging service, a rating group corresponding tothe requested virtual quota, usage information of the offline chargingservice and a rating group corresponding to the usage information; orwhen the service corresponding to the service resource identified by thesecond resource identifier includes an offline charging service, theservice resource update request further includes a requested virtualquota for the offline charging service and a rating group correspondingto the requested virtual quota; or when the service corresponding to theservice resource identified by the second resource identifier includesan offline charging service, the service resource update request furtherincludes usage information of the offline charging service and a ratinggroup corresponding to the usage information.

Optionally, the communications unit 902 is further configured to: aftersending a service resource update notification to the charging triggerapparatus, receive the service resource update request sent by thecharging trigger apparatus. The service resource update notificationincludes a third resource identifier, and the third resource identifieris used to identify a service resource, in the service resourceidentified by the first resource identifier, that the charging systemrequests to be updated.

Further, optionally, the service resource update request furtherincludes a rating group to which a service for which the charging systemrequests a service resource to be updated belongs, and the service is inthe services corresponding to a service resource identified by the thirdresource identifier.

Optionally, the communications unit 902 is further configured to receivea service resource delete request sent by the charging triggerapparatus, and the processing unit 901 is further configured to delete,based on the service resource delete request, a service resourceidentified by a fourth resource identifier. The service resource deleterequest includes the fourth resource identifier, and the fourth resourceidentifier is used to identify a service resource to be deleted from theservice resource identified by the first resource identifier. Theforegoing manner helps the charging system release the created serviceresource, to improve resource utilization in the charging system.

Optionally, when the service corresponding to the service resourceidentified by the fourth resource identifier includes an online chargingservice, the service resource delete request further includes usageinformation of the online charging service and a rating groupcorresponding to the usage information; or when the servicecorresponding to the service resource identified by the fourth resourceidentifier includes an offline charging service, the service resourcedelete request further includes usage information of the offlinecharging service and a rating group corresponding to the usageinformation.

It should be understood that the charging system may be configured toimplement the steps performed by the charging system in the chargingmethod in the embodiments of this disclosure. For related features,refer to the foregoing descriptions, and details are not describedherein again.

It should be understood that the division manner of the modules in thecharging trigger apparatus and the charging system shown in FIG. 7 andFIG. 9 is only an example, and is merely logical function division.There may be another division manner during actual implementation. Forexample, the communications unit is divided into a receiving unit and asending unit.

As shown in FIG. 10, an embodiment of this disclosure further provides acommunications system, and the communications system includes thecharging trigger apparatus 600 and the charging system 800.

All or some of the foregoing embodiments may be implemented by usingsoftware, hardware, firmware, or any combination thereof. When softwareis used to implement the embodiments, the embodiments may be all orpartially implemented in a form of a computer program product. Thecomputer program product includes one or more computer instructions.When the computer instructions are loaded and executed on a computer,the procedures or functions according to the embodiments of thisdisclosure are all or partially generated. The computer may be ageneral-purpose computer, a dedicate computer, a computer network, oranother programmable apparatus. The computer instructions may be storedin a computer-readable storage medium or may be transmitted from acomputer-readable storage medium to another computer-readable storagemedium. For example, the computer instructions may be transmitted from awebsite, computer, server, or data center to another website, computer,server, or data center in a wired (for example, a coaxial cable, anoptical fiber, or a digital subscriber line (DSL)) or wireless (forexample, infrared, radio, or microwave) manner. The computer-readablestorage medium may be any usable medium accessible by a computer, or adata storage device, such as a server or a data center, integrating oneor more usable media. The usable medium may be a magnetic medium (forexample, a floppy disk, a hard disk, or a magnetic tape), an opticalmedium (for example, a DVD), a semiconductor medium (for example, asolid state disk (SSD)), or the like.

Although this disclosure is described with reference to the embodiments,in a process of implementing this disclosure that claims protection, aperson skilled in the art may understand and implement other variationsof the disclosed embodiments by viewing the accompanying drawings, thedisclosed content, and the appended claims. In the claims, “comprising”does not exclude another component or another step, and “a” or “one”does not exclude a case of a plurality. A single processor or anotherunit may implement several functions enumerated in the claims. Somemeasures are recorded in dependent claims that are different from eachother, but this does not mean that these measures cannot be combined toproduce a better effect.

A person skilled in the art should understand that the embodiments ofthis disclosure may be provided as a method, an apparatus (device), acomputer-readable storage medium, or a computer program product.Therefore, this disclosure may use a form of hardware only embodiments,software only embodiments, or embodiments with a combination of softwareand hardware. They are collectively referred to as “modules” or“systems”.

This disclosure is described with reference to the flowcharts and/orblock diagrams of the method, the apparatus (device), and the computerprogram product in this disclosure. It should be understood thatcomputer program instructions may be used to implement each processand/or each block in the flowcharts and/or the block diagrams and acombination of a process and/or a block in the flowcharts and/or theblock diagrams. These computer program instructions may be provided fora general-purpose computer, a dedicated computer, an embedded processor,or a processor of another programmable data processing device togenerate a machine, so that the instructions executed by the computer orthe processor of the another programmable data processing devicegenerate an apparatus for implementing a specific function in one ormore processes in the flowcharts and/or in one or more blocks in theblock diagrams.

These computer program instructions may also be stored in acomputer-readable memory that can instruct the computer or anotherprogrammable data processing device to work in a specific manner, sothat the instructions stored in the computer-readable memory generate anartifact that includes an instruction apparatus. The instructionapparatus implements a specific function in one or more processes in theflowcharts and/or in one or more blocks in the block diagrams.

These computer program instructions may also be loaded onto a computeror another programmable data processing device, so that a series ofoperations and steps are performed on the computer or the anotherprogrammable device, thereby generating computer-implemented processing.Therefore, the instructions executed on the computer or the anotherprogrammable device provide steps for implementing a specific functionin one or more processes in the flowcharts and/or in one or more blocksin the block diagrams.

Although this disclosure is described with reference to specificfeatures and the embodiments thereof, obviously, various modificationsand combinations may be made to them without departing from the scope ofthis disclosure. Correspondingly, the specification and accompanyingdrawings are merely example description of this disclosure defined bythe accompanying claims, and are considered as any of or allmodifications, variations, combinations or equivalents that cover thescope of this disclosure. Obviously, a person skilled in the art canmake various modifications and variations to this disclosure withoutdeparting from the scope of this disclosure. This disclosure is intendedto cover these modifications and variations of this disclosure providedthat they fall within the scope of protection defined by the followingclaims and their equivalent technologies.

1. A charging method, comprising: sending, by a charging triggerapparatus, a service resource create request to a charging system,wherein the service resource create request is used to request thecharging system to create a service resource for a session between auser equipment and a data network; and receiving, by the chargingtrigger apparatus, a service resource create response from the chargingsystem, wherein the service resource create response comprises a firstresource identifier that is used to identify the service resourcecreated by the charging system in response to the service resourcecreate request; wherein the service resource is used to manage at leastone of: requesting for a quota for an online charging service in thesession, reporting of usage information of an online charging service inthe session, or reporting of usage information of an offline chargingservice in the session.
 2. The charging method according to claim 1,wherein the sending, by a charging trigger apparatus, a service resourcecreate request to a charging system comprises: when there is noavailable service resource, sending, by the charging trigger apparatus,the service resource create request to the charging system.
 3. Thecharging method according to claim 1, wherein the service resourcecreate request comprises a session identifier and a user identifiercorresponding to the user equipment, and wherein the session identifieris used to identify the session.
 4. The charging method according toclaim 1, wherein: the service resource create request comprises quotarequest information for the online charging service and a rating groupcorresponding to the quota request information; or the service resourcecreate request comprises usage information of the offline chargingservice and a rating group corresponding to the usage information of theoffline charging service.
 5. The charging method according to claim 1further comprises: sending, by the charging trigger apparatus, a serviceresource update request to the charging system, wherein the serviceresource update request comprises a second resource identifier that isused to identify the service resource.
 6. The charging method accordingto claim 5, wherein: the service resource update request furthercomprises at least one of the following: quota request information forthe online charging service, and a rating group corresponding to thequota request information; or usage information of the online chargingservice and a rating group corresponding to the usage information of theonline charging service; or the service resource update request furthercomprises usage information of the offline charging service and a ratinggroup corresponding to the usage information of the offline chargingservice.
 7. The charging method according to claim 5, wherein before thesending, by the charging trigger apparatus, a service resource updaterequest to the charging system, the charging method further comprises:receiving, by the charging trigger apparatus, a service resource updatenotification sent by the charging system, wherein the service resourceupdate notification comprises a third resource identifier, and whereinthe third resource identifier is used to identify the service resource.8. The charging method according to claim 1, further comprising:sending, by the charging trigger apparatus, a service resource deleterequest to the charging system, wherein the service resource deleterequest comprises a fourth resource identifier that is used to identifythe service resource.
 9. The charging method according to claim 8,wherein: the service resource delete request further comprises usageinformation of the online charging service and a rating groupcorresponding to the usage information of the online charging service;or the service resource delete request further comprises usageinformation of the offline charging service and a rating groupcorresponding to the usage information of the offline charging service.10. A charging method, comprising: receiving, by a charging system, aservice resource create request sent by a charging trigger apparatus,wherein the service resource create request is used to request thecharging system to create a service resource for a session between auser equipment and a data network; and sending, by the charging system,a service resource create response to the charging trigger apparatus,wherein the service resource create response comprises a first resourceidentifier that is used to identify the service resource created by thecharging system in response to the service resource create request;wherein the service resource is used to manage at least one of:requesting for a quota for an online charging service in the session,reporting of usage information of an online charging service in thesession, or reporting of usage information of an offline chargingservice in the session.
 11. The method according to claim 10, wherein:the service resource create request comprises quota request informationfor the online charging service and a rating group corresponding to thequota request information; or the service resource create requestcomprises usage information of the offline charging service and a ratinggroup corresponding to the usage information of the offline chargingservice.
 12. The method according to claim 10, wherein the methodfurther comprises: receiving, by the charging system, a service resourceupdate request sent by the charging trigger apparatus, wherein theservice resource update request comprises a second resource identifierthat is used to identify the service resource; and updating, by thecharging system based on the service resource update request, theservice resource.
 13. The method according to claim 12, wherein: theservice resource update request further comprises at least one of thefollowing: quota request information for the online charging service,and a rating group corresponding to the quota request information; orusage information of the online charging service and a rating groupcorresponding to the usage information of the online charging service;or the service resource update request further comprises usageinformation of the offline charging service and a rating groupcorresponding to the usage information of the offline charging service.14. The method according to claim 12, wherein before the receiving, by acharging system, a service resource update request sent by a chargingtrigger apparatus, the method further comprises: sending, by thecharging system, a service resource update notification to the chargingtrigger apparatus, wherein the service resource update notificationcomprises a third resource identifier that is used to identify theservice resource.
 15. The method according to claim 10, wherein themethod further comprises: receiving, by the charging system, a serviceresource delete request sent by the charging trigger apparatus, whereinthe service resource delete request comprises a fourth resourceidentifier that is used to identify the service resource; and deleting,by the charging system based on the service resource delete request, theservice resource.
 16. The method according to claim 15, wherein: theservice resource delete request further comprises usage information ofthe online charging service and a rating group corresponding to theusage information of the online charging service; or the serviceresource delete request further comprises usage information of theoffline charging service and a rating group corresponding to the usageinformation of the offline charging service.
 17. A charging triggerapparatus, comprising: at least one processor; and one or more memoriescoupled to the at least one processor and storing programminginstructions for execution by the at least one processor to: send aservice resource create request to a charging system, wherein theservice resource create request is used to request the charging systemto create a service resource for a session between a user equipment anda data network; and receive a service resource create response from thecharging system, wherein the service resource create response comprisesa first resource identifier that is used to identify the serviceresource that is created by the charging system in response to theservice resource create request; wherein the service resource is used tomanage at least one of: requesting for a quota for an online chargingservice in the session, reporting of usage information of an onlinecharging service in the session, or reporting of usage information of anoffline charging service in the session.
 18. The charging triggerapparatus according to claim 17, wherein the one or more memoriescoupled to the at least one processor and storing the programminginstructions for execution by the at least one processor to: send aservice resource update request to the charging system, wherein theservice resource update request comprises a second resource identifierthat is used to identify the service resource.
 19. The charging triggerapparatus according to claim 18, wherein the one or more memoriescoupled to the at least one processor and storing the programminginstructions for execution by the at least one processor to: receive,before sending the service resource update request to the chargingsystem, a service resource update notification sent by the chargingsystem, wherein the service resource update notification comprises athird resource identifier that is used to identify the service resource.20. The charging trigger apparatus according to claim 17, wherein theone or more memories coupled to the at least one processor and storingthe programming instructions for execution by the at least one processorto: send a service resource delete request to the charging system,wherein the service resource delete request comprises a fourth resourceidentifier that is used to identify the service resource.
 21. A chargingsystem, comprising: at least one processor; and one or more memoriescoupled to the at least one processor and storing programminginstructions for execution by the at least one processor to: receive aservice resource create request sent by a charging trigger apparatus,wherein the service resource create request is used to request thecharging system to create a service resource for a session between auser equipment and a data network; and send a service resource createresponse to the charging trigger apparatus, wherein the service resourcecreate response comprises a first resource identifier that is used toidentify the service resource created by the charging system in responseto the service resource create request; wherein the service resource isused to manage at least one of: requesting for a quota for an onlinecharging service in the session, reporting of usage information of anonline charging service in the session, or reporting of usageinformation of an offline charging service in the session.
 22. Thecharging system according to claim 21, wherein the one or more memoriescoupled to the at least one processor and storing the programminginstructions for execution by the at least one processor to: receive aservice resource update request sent by the charging trigger apparatus,wherein the service resource update request comprises a second resourceidentifier that is used to identify the service resource; and update theservice resource based on the service resource update request.
 23. Thecharging system according to claim 21, wherein the one or more memoriescoupled to the at least one processor and storing the programminginstructions for execution by the at least one processor to: send,before receiving a service resource update request sent by the chargingtrigger apparatus, a service resource update notification to thecharging trigger apparatus, wherein the service resource updatenotification comprises a third resource identifier that is used toidentify the service resource.
 24. The charging system according toclaim 21, wherein the one or more memories coupled to the at least oneprocessor and storing the programming instructions or execution by theat least one processor to: receive a service resource delete requestsent by the charging trigger apparatus, wherein the service resourcedelete request comprises a fourth resource identifier that is used toidentify the service resource; and delete the service resource based onthe service resource delete request.
 25. A communications system,comprising a charging trigger apparatus and a charging system, wherein:the charging trigger apparatus comprises: at least one processor; andone or more memories coupled to the at least one processor and storingprogramming instructions for execution by the at least one processor to:send a service resource create request to a charging system, wherein theservice resource create request is used to request the charging systemto create a service resource for a session between a user equipment anda data network; receive a service resource create response from thecharging system, wherein the service resource create response comprisesa first resource identifier that is used to identify the serviceresource created by the charging system in response to the serviceresource create request; and wherein the service resource is used tomanage at least one of: requesting for a quota for an online chargingservice in the session, reporting of usage information of an onlinecharging service in the session, or reporting of usage information of anoffline charging service in the session; and wherein the charging systemcomprises: at least one processor; and one or more memories coupled tothe at least one processor and storing programming instructions forexecution by the at least one processor to: receive the service resourcecreate request sent by the charging trigger apparatus; and send theservice resource create response to the charging trigger apparatus.